import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/temperature',
      name: 'temperature',
      component: () => import('../views/TemperatureView.vue'),
    },
    {
      path: '/length',
      name: 'length',
      component: () => import('../views/LengthView.vue'),
    },
    {
      path: '/weight',
      name: 'weight',
      component: () => import('../views/WeightView.vue'),
    },
    {
      path: '/currency',
      name: 'currency',
      component: () => import('../views/CurrencyView.vue'),
    },
    {
      path: '/memo',
      children: [
        {
          path: '',
          component: () => import('../views/MemoView.vue'),
        },
        {
          path: ':id',
          component: () => import('../views/MemoItemView.vue'),
        },
      ],
    },
  ],
});

export default router;
